package com.tang.sys.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Set;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 文章表
 * </p>
 *
 * @author shankaka
 * @since 2023-04-14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sg_article")
@ApiModel(value = "Article对象", description = "文章表")
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("文章内容")
    private String content;

    @ApiModelProperty("文章摘要")
    private String summary;

    @ApiModelProperty("所属分类id")
    private Long categoryId;

    @TableField(exist = false)
    private String categoryName;

    @ApiModelProperty("缩略图")
    private String thumbnail;

    @ApiModelProperty("是否置顶（0否，1是）")
    private String isTop;

    @ApiModelProperty("状态（0已发布，1草稿）")
    private String status;

    @ApiModelProperty("访问量")
    private Long viewCount;

    @ApiModelProperty("是否允许评论 1是，0否")
    private String isComment;
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateBy;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty("删除标志（0代表未删除，1代表已删除）")
    private Integer delFlag;

    @TableField(exist = false)
    List<Long> tags;
    @TableField(exist = false)
    List <Long> tagss;

    @TableField(exist = false)
    private String userName;


    public Article(Long id, long viewCount) {
        this.id = id;
        this.viewCount = viewCount;
    }
}
